namespace Peer2PeerControlLibraryWPF.VisualStudio.Design
{
    using System;
    using Microsoft.Windows.Design.Metadata;
    using Microsoft.Windows.Design.Features;
    using C4F.VistaP2P.WPF.Network;
    using C4F.VistaP2P.WPF.Chat;
    using C4F.VistaP2P.WPF.File;
    using C4F.VistaP2P.WPF.Picture;
    using C4F.VistaP2P.WPF.Media;

    /// <summary>
    /// Container for any general design-time metadata that we want to initialize.
    /// Designers will look for a type in the design-time assembly that implements IRegisterMetadata.
    /// If found, they will instantiate it and call its Register() method automatically.
    /// </summary>
    internal class Metadata : IRegisterMetadata {

        // Called by Cider to register any design-time metadata
        public void Register() {
            AttributeTableBuilder builder = new AttributeTableBuilder();

            // Adorners
            builder.AddCustomAttributes(typeof(NetworkManager), new FeatureAttribute(typeof(NetworkManagerAdornerProvider)));
            builder.AddCustomAttributes(typeof(ChatControl), new FeatureAttribute(typeof(ChatControlAdornerProvider)));
            builder.AddCustomAttributes(typeof(FileControl), new FeatureAttribute(typeof(FileControlAdornerProvider)));
            builder.AddCustomAttributes(typeof(PictureControl), new FeatureAttribute(typeof(PictureControlAdornerProvider)));
            builder.AddCustomAttributes(typeof(MediaControl), new FeatureAttribute(typeof(MediaControlAdornerProvider)));

            MetadataStore.AddAttributeTable(builder.CreateTable());
        }
    }
}
